
<h1><?php echo $title; ?></h1>


<?php if (isset($notice) || $notice = $this->session->flashdata('notification')):?>
<p class="notice"><?php echo $notice;?></p>
<?php endif;?>
<div class="well"><p class="lead"><?php echo __("Numero sostenitori : " . " <span style='font-weight: strong; font-size: 110%; color: red;'>" . $total . "</span>"); ?></p></div>


<form action="<?php echo site_url('adozioni/stampe/ricevute/fiscali') ?>/<?php if(!is_null($id_sostenitore)) echo $id_sostenitore; ?>" method="post">

<label for="anno">Anno:</label>
<select id="anno" name="anno">
<option value="<?php echo (date("Y") - 1) ?>"><?php echo (date("Y") - 1) ?></option>
<?php for($i= date("Y"); $i >= date("Y") - 10; $i--): ?>
<option value="<?php echo $i ?>"><?php echo $i ?></option>
<?php endfor; ?>
</select>

<label for="with_header">Con intestazione: </label>
<input type="checkbox" name="with_header" value="1" />


<div class="form">


<div class="row">
<div class="col-md-2">


<label for="testo"><?php echo __("Contenuto", $module) ?></label>

</div>
<div class="col-md-9">

<div class="toolbox">
<input type="button" id="{TITOLO}" class="btn button btn-primary" value="TITOLO"/>
<input type="button" id="{NOME}" class="btn button btn-primary" value="NOME"/>
<input type="button" id="{CODICE_FISCALE}" class="btn button btn-primary" value="CODICE FISCALE"/>
<input type="button" id="{INDIRIZZO}" class="btn button btn-primary" value="INDIRIZZO"/>
<input type="button" id="{IMPORTO}" class="btn button btn-primary" value="IMPORTO"/>
<input type="button" id="{IMPORTO_IN_LETTERA}" class="btn button btn-primary" value="IMPORTO IN LETTERA"/>
<input type="button" id="{DATA}" class="btn button btn-primary" value="DATA"/>
<input type="button" id="{ANNO}" class="btn button btn-primary" value="ANNO"/>

</div>
<textarea  name="testo_ricevuta" id="testo_ricevuta" rows=10 class="form-control ckeditor" ><?php if($testo_ricevuta) echo $testo_ricevuta ?></textarea>

</div>
</div>


<div class="buttons">


<input type="submit" name="salva" id="submit" value=" <?php echo __("Salva contenuto", $module) ?> " class="btn btn-success"/>

<input type="submit" name="salva_e_stampa" id="submit" value=" <?php echo __("Salva e stampa", $module) ?> " class="btn btn-success"/>

<a  class="btn btn-primary" href="<?php echo site_url('adozioni/contabilita/offerte') ?>" ><?php echo __("Annulla", $module) ?></a>

</div>
</div>

</form>

<script type="text/javascript">
function InsertHTML(html) {
	// Get the editor instance that we want to interact with.
	var editor = CKEDITOR.instances.testo_ricevuta;
	// Check the active editing mode.
	if ( editor.mode == 'wysiwyg' )
	{
		// Insert HTML code.
		// http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-insertHtml
		editor.insertHtml( " "+html );
	}
	else
		alert( 'You must be in WYSIWYG mode!' );
}

$(function(){

	$(".button").click(function(){
		InsertHTML($(this).attr('id'));
	
	});
});


/**
 * @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.html or http://ckeditor.com/license
 */

CKEDITOR.editorConfig = function( config ) {
	// Define changes to default configuration here. For example:
	// config.language = 'fr';
	// config.uiColor = '#AADC6E';
	config.toolbarGroups = [
    { name: 'document',    groups: [ 'mode', 'document', 'doctools' ] },
    { name: 'editing',     groups: ['undo', 'spellchecker' ] },
    { name: 'links' },
    { name: 'insert' },
  
    '/',
    { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
    { name: 'paragraph',   groups: [ 'list', 'indent', 'blocks', 'align' ] },
    { name: 'styles' },
    { name: 'colors' },
	];
	
   config.filebrowserBrowseUrl = '/application/modules/adozioni/js/kcfinder/browse.php?type=files';
   config.filebrowserImageBrowseUrl = '/application/modules/adozioni/js/kcfinder/browse.php?type=images';
   config.filebrowserFlashBrowseUrl = '/application/modules/adozioni/js/kcfinder/browse.php?type=flash';
   config.filebrowserUploadUrl = '/application/modules/adozioni/js/kcfinder/upload.php?type=files';
   config.filebrowserImageUploadUrl = '/application/modules/adozioni/js/admin/kcfinder/upload.php?type=images';
   config.filebrowserFlashUploadUrl = '/application/modules/adozioni/js/admin/kcfinder/upload.php?type=flash';
   config.extraPlugins = 'youtube,iframe';	
	
};
CKEDITOR.replace( 'testo_ricevuta');
</script>